package com.haixiaoke.saas.enterprise.order.controller;

import cn.hutool.core.date.DateUtil;
import com.haixiaoke.saas.common.core.domain.AjaxResult;
import com.haixiaoke.saas.order.domain.OrderLock;
import com.haixiaoke.saas.order.service.IOrderLockService;
import com.haixiaoke.saas.system.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 订单锁单Controller
 * 
 * @author panda
 * @date 2024-02-01
 */
@RestController
@RequestMapping("/biz/lock")
public class EnterpriseOrderLockController extends BaseController {
    @Autowired
    private IOrderLockService orderLockService;

    @GetMapping("/lockListByHouseId")
    public AjaxResult lockListByHouseId(String houseId){
        List<OrderLock> lockList = orderLockService.selectOrderLockListByHouseId(houseId, DateUtil.date());
        return success(lockList);
    }
}
